/**
 * 
 */
package name.yzhu.wordsearch;

import java.util.HashMap;
import java.util.Map;

/**
 * search mode , there are 2 way for now, WRAP and NO_WRAP
 * @author yhzhu
 *
 */
public enum SearchMode {
	WRAP("WRAP"),
	NO_WRAP("NO_WRAP"),
	UNKNOWN("");
	
	private String mode ;
	
	static private Map<String, SearchMode>strMapToMode = new HashMap<String, SearchMode>();
	
	static{
		for(SearchMode sm : SearchMode.values()){
			strMapToMode.put(sm.getMode(), sm);
		}
	}
	
	static public SearchMode byStrToMode(String mode){
		return strMapToMode.get(mode);
	}
	
	private SearchMode(String mode){
		this.mode = mode;
	}
	
	public String getMode(){
		return mode;
	}
}

